﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace PaymentHelper.Core.RelatedObject
{
    public partial class Address
    {
        #region Contructor
        public Address()
        {
            FirstName = "";
            LastName = "";
            Email = "";
            Company = "";
            Country = "VN";
            City = "";
            StateProvince = "";
            Address1 = "";
            Address2 = "";
            ZipPostalCode = "";
            PhoneNumber = "";
            FaxNumber = "";
        }
        #endregion

        #region Properties

        /// <summary>
        /// Gets or sets the first name
        /// </summary>
        public virtual string FirstName { get; set; }

        /// <summary>
        /// Gets or sets the last name
        /// </summary>
        public virtual string LastName { get; set; }

        /// <summary>
        /// Gets or sets the email
        /// </summary>
        public virtual string Email { get; set; }

        /// <summary>
        /// Gets or sets the company
        /// </summary>
        public virtual string Company { get; set; }

        /// <summary>
        /// Gets or sets the country code
        /// </summary>
        public virtual string Country { get; set; }

        /// <summary>
        /// Gets or sets the state/province identifier
        /// </summary>
        public virtual string StateProvince { get; set; }

        /// <summary>
        /// Gets or sets the city
        /// </summary>
        public virtual string City { get; set; }

        /// <summary>
        /// Gets or sets the address 1
        /// </summary>
        public virtual string Address1 { get; set; }

        /// <summary>
        /// Gets or sets the address 2
        /// </summary>
        public virtual string Address2 { get; set; }

        /// <summary>
        /// Gets or sets the zip/postal code
        /// </summary>
        public virtual string ZipPostalCode { get; set; }

        /// <summary>
        /// Gets or sets the phone number
        /// </summary>
        public virtual string PhoneNumber { get; set; }

        /// <summary>
        /// Gets or sets the fax number
        /// </summary>
        public virtual string FaxNumber { get; set; }

        /// <summary>
        /// Get a string presents the full information of address
        /// </summary>
        /// <returns></returns>
        public virtual string GetFullAdress(bool showZipCode = false)
        {
            if(showZipCode)
                return string.Format("{0} {1} {2}, Zipcode:{3}",Address1,City,Country,ZipPostalCode);

            return string.Format("{0} {1} {2}",Address1,City,Country);
        }

        #endregion
    }
}
